#=====================================================================
READ ME
Title: Strengthening the Party, Weakening the Women
Journal: The Journal of Politics
Authors: Andrea Junqueira and Patrick Cunha Silva
Contact information: andrea.junqueira.m@gmail.com|pcunhasilva@luc.edu
#=====================================================================

INTRUCTIONS:

All results found in the paper and appendices are replicated by the script Replication.R.
Tables and figures are saved to their corresponding folder, depending on where they appear
in the paper (e.g., Main Paper, Appendix A, Appendix C): MainPaperResults, AppendixAResults,
AppendixCResults, AppendixDResults, AppendixEResults, AppendixFResults, AppendixGResults, 
AppendixHResults, AppendixIResults.
Folders destined to contain results (e.g., MainPaperResults, AppendixAResults,
AppendixCResults) are initially empty; they are populated with results after the 
script Replication.R is executed. 
In Replication.R, set the directory to the root folder.

The reported statistical analysis was performed using the following operational system,
software version, and package versions:

> sessionInfo()
R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 20.3

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lmtest_0.9-40   zoo_1.8-10      readxl_1.4.0    stargazer_5.2.3 sandwich_3.0-2  rdpower_2.2     rdrobust_2.1.1 
[8] rddensity_2.2  

loaded via a namespace (and not attached):
[1] pillar_1.7.0     compiler_4.2.2   cellranger_1.1.0 tools_4.2.2      digest_0.6.29    lifecycle_1.0.1 
[7] tibble_3.1.7     gtable_0.3.0     lattice_0.20-45  pkgconfig_2.0.3  rlang_1.0.4      DBI_1.1.3       
[13] cli_3.4.1        rstudioapi_0.13  dplyr_1.0.9      generics_0.1.2   vctrs_0.4.1      grid_4.2.2      
[19] tidyselect_1.1.2 glue_1.6.2       R6_2.5.1         lpdensity_2.3.1  fansi_1.0.3      farver_2.1.0    
[25] ggplot2_3.3.6    purrr_0.3.4      magrittr_2.0.3   scales_1.2.0     ellipsis_0.3.2   MASS_7.3-58     
[31] assertthat_0.2.1 colorspace_2.0-3 labeling_0.4.2   utf8_1.2.2       munsell_0.5.0    crayon_1.5.1    


#########
# FILES #
#########

#--R Scripts--#

- ./Replication.R
Replicates all results presented in the main paper and appendices.

- ./Code/fun_analysis.R
Contains all the functions used in the remaining R scripts.

- ./Code/paperAnalysis.R
Reproduces the results presented in the main text of the manuscript.

- ./Code/AppendixA.R
Reproduces the results presented in Appendix A.

- ./Code/AppendixC.R
Reproduces the results presented in Appendix C.

- ./Code/AppendixD.R
Reproduces the results presented in Appendix D.

- ./Code/AppendixE.R
Reproduces the results presented in Appendix E.

- ./Code/AppendixF.R
Reproduces the results presented in Appendix F.

- ./Code/AppendixG.R
Reproduces the results presented in Appendix G.

- ./Code/AppendixH.R
Reproduces the results presented in Appendix H.

- ./Code/AppendixI.R
Reproduces the results presented in Appendix I.

-----------------------

#--Datasets--#

- ./Data/d.R
Main dataset

- ./Data/d_balance.RData
Balance checks (party-municipality level)

- ./Data/balance_ind.RData
Balance checks (candidate level)

- ./Data/bal_checks_census.RData
Balance checks (municipal level)

- ./Data/DespesaMunicipal.RData
Campaign expenditures

- ./Data/median_df.RData
Allows analysis using the median vote share (as opposed to the average)

- ./Data/loyalty_cases.RData
TREs cases involving the loyalty rule

- ./Data/tse_ibge.RData
Correspondence between TSE and IBGE municipal ids.

-----------------------

#--Codebook--#

- ./codebook.txt
Informs about all variables' names and their meanings



